package com.richfun.boot.controller;

import com.github.pagehelper.PageInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

public class BaseController {
    Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 重新组装分页返回数据
     * */
    Map<String,Object> getPageMap(PageInfo pageInfo) {
        Map<String, Object> pageMap = new HashMap<>();
        pageMap.put("code", 0);
        pageMap.put("count", pageInfo.getTotal());
        pageMap.put("data", pageInfo.getList());
        return pageMap;
    }

}
